
<table width="100%" cellpadding="0" cellspacing="0" class="liststyle data" id="_normal_payment">
            <colgroup class="span-5 ColColorGray"></colgroup>
            <colgroup class="span-auto"></colgroup>
  <tr id="_pay_cod" style="display:<{if $delivery.has_cod == 1}>block<{else}>none<{/if}>">
    <th style="text-align:left;"><input type="radio" name="payment[payment]" value="-1" paytype="offline" id="payment_bank" class="x-payMethod"<{if $order.payment==-1}> checked="checked"<{/if}> /><{t}><strong>货到付款</strong><{/t}></th>
    <td><{t}>由我们的快递人员在将货物送到时收取货款。<{/t}></td>
  </tr>

  <{foreach from=$payments item="payment" key="key"}>
  <tr>
    <th style="text-align:left;" >
    <script>
      var changePrice=changePrice||$empty;
    </script>
    <label <{if $payment.extend}>class="ExtendCon"<{/if}>><input class="x-payMethod" type="radio" name="payment[payment]" paytype="<{$payment.pay_type}>" value="<{$payment.id}>"<{if $order.payment==$payment.id}> checked="checked"<{/if}> moneyamount="<{$payment.money}>" formatmoney ="<{$payment.money|cur:$order.currency}>" onclick="changePrice($(this).get('moneyamount'),$(this).get('formatmoney'),$(this).get('paytype'));"/><{$payment.custom_name}><{if $payment.fee>0}><{t}> (支付费率: +<{/t}><{$payment.fee*100}>%)<{/if}>
	<!-- alone add start -->
	<{if $payment.pay_type=="icbc"}>
	<select name="icbc_period">
		<option value="1">全额付款</option>
		<option value="6">六期</option>
		<option value="9">九期</option>
		<option value="12">十二期</option>
	</select>
	<{/if}>
	<!-- alone add end -->
	</label>

</td><td><{$payment.des|default:'&nbsp;'}></th>
  </tr>
    <{if $payment.extend}>
                <{foreach from=$payment.extend item="extvalue" key="extkey"}>
                    <tr class="<{$extvalue.extconId}>" style="display:none">
                        <th></th>
                        <td>
                                 <{if $extvalue.fronttype<>'select'}>
								<ul >
                                  	<{foreach from=$extvalue.value name="bank" item=extsval key=extskey}>
									<li style="width:10em;float:left;">
                                                <{if $extvalue.fronttype=="radio"}>
                                                    <input <{$extsval.checked}> type=<{$extvalue.fronttype}> name=<{$extvalue.name}> value=<{$extsval.value}>>
                                                    <{if $extsval.imgurl}><{$extsval.imgurl}><{else}><{$extsval.name}><{/if}>
                                                <{else if $extvalue.fronttype=="checkbox"}>
                                                    <input <{$extsval.checked}> type="<{$extvalue.fronttype}>" name="<{$extvalue.name}>[]" value="<{$extsval.value}>">
                                                    <{if $extsval.imgurl}><{$extsval.imgurl}><{else}><{$extsval.name}><{/if}>
                                                <{/if}>
									</li>
								<{/foreach}>
								</ul>
                                <{else}>
                                    <select name=$extvalue.name>
                                       <{foreach from=$extvalue.value item=extsval key=extskey}>
                                            <option value=<{$extsval.value}> <{if $extsval.checked}>selected<{/if}>><{$extsval.name}></option>
                                        <{/foreach}>
                                    <select>
                                <{/if}>
                        </td>
                    </tr>
                <{/foreach}>
           <{/if}>
  <{/foreach}>

</table>
<script>

  	$ES('input.x-payMethod','_normal_payment').each(function(el){
		if(!el.getParent('.ExtendCon'))return;
		if(el.checked){
			var bank=el.getParent('tr').getNext('tr');
			bank.setStyle('display','');
			bank.addClass('checked');
			var table=el.getParent('table');
			table.store('childcheck',bank);
		}
	});
        $ES('input.x-payMethod','payment').addEvent('click',function(){
			var table=this.getParent('table');
			if(this.getParent('label[class=ExtendCon]')){
				var childNode=this.getParent('tr').getNext('tr');
				if(!childNode)return;
				if(table.retrieve('childcheck')){
					table.retrieve('childcheck').setStyle('display','none');
					table.retrieve('childcheck').removeClass('checked');
				}
				childNode.setStyle('display','');
				childNode.addClass('checked');
				table.store('childcheck',childNode);
			}else{
				$ES('#_normal_payment .showbank').setStyle('display','none');
				if(!table.retrieve('childcheck'))return;
				table.retrieve('childcheck').removeClass('checked');
			}
	  	});


</script>
